#!/bin/bash

if pidof wf-recorder
then
  pkill -2 wf-recorder && notify-send 录屏结束！
  exit
fi

geometry=$(slurp -d)
if [ -n "${geometry}" ]
then
  wf-recorder -a -f ~/视频/recording-$(date +%Y_%m_%d-%H_%M_%S).mp4 -g "${geometry}" -c hevc_vaapi -d /dev/dri/by-path/pci-0000:00:02.0-render
fi
